$OpenBSD: patch-common_osdep_h,v 1.3 2015/07/06 21:54:33 ajacoutot Exp $
--- common/osdep.h.orig	Sun Jul  5 01:21:16 2015
+++ common/osdep.h	Sun Jul  5 01:23:16 2015
@@ -234,7 +234,8 @@ int x264_threading_init( void );
 static ALWAYS_INLINE int x264_pthread_fetch_and_add( int *val, int add, x264_pthread_mutex_t *mutex )
 {
 #if HAVE_THREAD
-#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 0) && ARCH_X86
+#if defined(__GNUC__) && (__GNUC__ > 4 || __GNUC__ == 4 && __GNUC_MINOR__ > 0) &&\
+      (ARCH_X86 || ARCH_X86_64 || ARCH_ALPHA || ARCH_PPC || ARCH_SPARC)
     return __sync_fetch_and_add( val, add );
 #else
     x264_pthread_mutex_lock( mutex );
